/*
 * UserManager.h
 *
 *  Created on: Nov 11, 2013
 *      Author: ruben
 */

#ifndef USERMANAGER_H_
#define USERMANAGER_H_

#include <stdio.h>
#include "../Entities/User.h"
#include "../indexManager/indexManager.h"

#define BUCKET_SIZE 100
#define VERIFICADO 1
#define ADMIN 'A'
#define USER 'U'
#define PROVEEDOR 'P'

#define nUSER 0
#define nPROVEEDOR 2
#define nADMIN 2

class UserManager {
public:
	UserManager();
	virtual ~UserManager();

	int crear(BigInt dni, const String& name, const String& lastName, const String& email, const String& password, const String& province, char type);
	int eliminar(BigInt id);
	int modificar(BigInt idBuscado, const String& name, const String& lastName, const String& email, const String& password, const String& province);
	int buscarIDyVerificarDatos(BigInt identifier, const String& pass);
	int buscarIDyVerificarTipo(BigInt identifier, const String& pass, int type);
	int crearUsuarioAdmin(BigInt id);
	int eliminarUsuarioAdmin(BigInt id);
	int recuperarPassword(BigInt id, String& password);

private:
	indexManager indice;
};

#endif /* USERMANAGER_H_ */
